package com.xwh.week4;

public class Practice9 {//写的总感觉怪怪的；
    static int arrays[]=new int[1001];
    public static void main(String[] args) {
        for (int i = 1; i <= 32; i++) {
            for (int j = i + 1; j <= 32; j++) {
                if ((method1(i, j) - 1)!=0) continue;
                int a = 2 * i * j;
                int b = j * j - i * i;
                int c = i * i + j * j;
                for (int p = a + b + c; p <= 1000; p += (a + b + c)) {
                    arrays[p] += 1;
                }
            }
        }
        int ans=0;
        for(int i=3;i<1000;i++){
            if(arrays[i]>=arrays[ans]){
                ans=i;
            }
        }
        System.out.println(ans);
    }
    public static int method1(int a, int b) {
        return (b!=0 ? method1(b, a % b) : a);
    }
}

